1. Field of Invention
The present invention relates to computer virtualization technology, more particularly, to a virtual machine monitor, a virtual machine system and a clock distribution method thereof.
2. Description of Prior Art
Virtualization technology may be used to simultaneously run a plurality of Guest Operation Systems (GOSs) and a plurality of virtual CPUs on one and the same hardware platform.
Timing in the existing computer is provided from six kinds of clock hardware, each of which provides a clock square wave signal input based on a crystal oscillator with a fixed frequency. Different operating systems may select appropriate clock hardware as their own timers.
The existing six kinds of clock hardware are illustrated as follows.
High Precision Event Timer (HPET), which provides a highly precise clock, and may provide up to 32 timers, with precision and efficiency higher than other clocks;
Real Time Clock (RTC), which is powered by a battery on a main board, so that it can hold time after PC power-down. It is also called a CMOS timer;
Programmable Interval Timer (PIT), which generates a periodic clock interrupt signal by Interrupt Request 0 (IROO);
Power Manager Timer (PMT);
Local Advanced Programmable Interrupt Controller (APIC) Vector Table Timer (LVTT); and
Time Stamp Counter (TSC), which is an incremental timer, increases one each time a clock signal of the CPU arrives. The value of the TSC can be read through an assembly instruction. With the TSC of the CPU, the operating system usually may obtain a more precise time metric.
In the existing virtual machine system, a Virtual Machine Monitor (VMM) virtualizes all of the clock hardware described above, so that all the GOSs can share these virtual clocks.
Since all of these clocks in the VMM are virtual, disadvantages of inaccurate timing and time delay may occur. Therefore, there is a need to provide GOSs of a virtual machine system with an accurate clock.